<template>
  <div class="index">
    <el-container>
      <el-aside width="200px">
        <!-- 左侧菜单栏 -->
        <el-menu
          default-active="/index/business"
          class="el-menu-vertical-demo"
          @select="handleSelect"
        >
        <div class="guanli" >
          <el-icon><HomeFilled /></el-icon>
          <span>考勤管理</span>
          <el-icon><MoreFilled /></el-icon>
          <span>+</span>
        </div>
        <!-- 4个菜单项 -->
          <el-menu-item index="/index/business">
            <el-icon><Tickets /></el-icon>
            <span>出差申请</span>
          </el-menu-item>
          <el-menu-item index="/index/outside">
            <el-icon><Tickets /></el-icon>
            <span>外勤打卡</span>
          </el-menu-item>
          <el-menu-item index="/index/leave">
            <el-icon><Tickets /></el-icon>
            <span>请假申请</span>
          </el-menu-item>
          <el-menu-item index="/index/work">
            <el-icon><Tickets /></el-icon>
            <span>加班申请</span>
          </el-menu-item>
        </el-menu>
      </el-aside>
      <!-- 占位组件 -->
      <router-view></router-view>
    </el-container>
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router'
var $router = useRouter()
// 点击菜单项跳转路由
var handleSelect = (index)=>{
  $router.push(index)
}
</script>

<style scoped>
.el-menu-item{
  font-size: 16px;
}
.el-menu-item.is-active{
  background-color: rgb(157, 238, 195);
  color: rgb(236, 110, 64);
  font-size: 18px;
}
.guanli{
  height: 80px;
  display: flex;
  margin: 0 10px;
  align-items: center;
}
.guanli :nth-child(1){
  font-size: 20px;
}
.guanli :nth-child(2){
  font-size: 18px;
  margin-left: 10px;
}
.guanli :nth-child(3){
  font-size: 20px;
  margin-left: 25px;
  color: gray;
}
.guanli :nth-child(4){
  font-size: 20px;
  margin-left: 5px;
  width: 20px;
  height: 20px;
  background-color: orange;
  border-radius: 50%;
  color: white;
  text-align: center;
  line-height: 16px;
}

</style>